<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../../vue.js"></script>
</head>

<style>
  /* 公共样式 */
  .public {
    width: 200px;
    height: 200px;
    text-align: center;
    line-height: 200px;
    background-color: black;
  }

  .red {
    font-size: 20px;
    color: red;
  }

  .font {
    font-size: 16px;
  }

  .bold {
    font-weight: bold;
  }

  .orange {
    font-size: 24px;
    color: orange;
  }

  .active {
    font-weight: bolder;
  }

  .pink {
    color: pink;
  }
</style>

<body>
  <div id="app">
    <h1>{{msg}}</h1>
    <p class="public" :class="red">23点22分</p>
    <p class="public" :class="classStyle">23点24分</p>
    <!-- 通过布尔值控制 -->
    <p class="public" :class="{orange:isorange,active:isactive}">23点30分</p>
    <!-- 值为数组 -->
    <p class="public" :class="classArr">23点33分</p>
  </div>
  <script>
    Vue.config.productionTip = false;
    const vm = new Vue({
      el: "#app",
      data() {
        return {
          msg: "hello vue!",
          red: 'red',
          classStyle: {
            red: true,
            font: true,
            bold: true
          },
          isorange: true,
          isactive: false,
          classArr: ['pink']
        }

      },
      methods: {}
    })
  </script>
</body>

</html>